<!DOCTYPE html>
<html>

<head>
<title>添加代理</title>
<meta http-equiv="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">

<%include("/common/include.html"){}%>
<style type="text/css">
	.required{
		display:inline-block;
		width: 30%;
	}
	.requiredx{
		display:inline-block;
		width: 89%;
	}
	label{
		text-align:right;
		width:70px;
		display:inline-block;
	}
</style>
</head>

<body>
	<div class="easyui-panel" style="width: 100%; padding: 30px 60px; border-width: 0px;">
		<form id="upProduct" method="post" class="form">
			<div style="margin-bottom: 20px;">
				<label class="label-top">类型:</label>
				<div class="required">
					<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" value="${product.type.name! }"  readonly="readonly">
				</div>
				<span style="color:red">*必填项</span>
				<input type="hidden" name="product.typeIds" value="${product.type.ids! }" />
				<input type="hidden" name="product.ids" value="${product.ids! }" />

				<label class="label-top" style="margin-left:30px;">编号:</label>
				<div class="required">
					<input name="product.proBh" class="easyui-textbox theme-textbox-radius" style="width: 100%;" value="${product.proBh! }"  readonly="readonly">
				</div>
				<span style="color:red">*必填项</span>
			</div>
			<div style="margin-bottom: 20px">
				<label class="label-top">名称:</label>
				<div class="required">
					<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="product.name" value="${product.name! }">
				</div>
				<span style="color:red">*必填项</span>
				<label class="label-top" style="margin-left:30px;">规格:</label>
				<div class="required">
					<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="product.proSpecification" value="${product.proSpecification! }">
				</div>
				<span style="color:red">*必填项</span>
			</div>
			
	<!-- 		<div style="margin-bottom: 20px">
				<label class="label-top">单位:</label>
				<div class="required">
					<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="product.proUnits" value="${product.proUnits! }">
				</div>
				<span style="color:red">*必填项</span>
				<label class="label-top" style="margin-left:30px;">容量:</label>
				<div class="required">
					<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="product.proCapacity" value="${product.proCapacity! }">
				</div>
				<span style="color:red">*必填项</span>
			</div> -->
			
		<!-- 	<div style="margin-bottom: 20px">
					
				<label class="label-top" >产品用途:</label>
				<div class="required">
					<#code id="proUseIds" name="product.useIds" class="easyui-combobox theme-textbox-radius" code="code_cpyt" style="width: 100%;"/>
				</div>
				<span style="color:red">*必填项</span>
				<%if(product.type.name=='瘦身'){%>
				<label class="label-top" style="margin-left:30px">经验值:</label>
				<div class="required">
					<input class="easyui-textbox theme-textbox-radius" style="width: 100%;" name="product.proExperience">
				</div>
				<span style="color:red">*必填项</span>
				<%}%>
			</div>
			 -->
			 
			<div style="margin-bottom: 20px">
					<label class="label-top">次数:</label>
					<div class="required">
						<input class="easyui-textbox theme-textbox-radius" style="width: 100%;"  value="${product.proExperience!}" name="product.proExperience" data-options="prompt:'例：次'"  >
					</div>
					<span style="color:red"></span>
					<label class="label-top" style="margin-left:80px">非卖:</label>
					<div class="required">
						<select  name="product.notSell"     style="width: 100%;height: 35px"   >
						<option 
							<%if(product.notSell=='1'){%>
							selected="selected"  
							<%}%>
						  value="1">否</option>
						<option   
						<%if(product.notSell=='0'){%>
						 selected="selected" 
						 <%}%>
						 
						  value="0">是</option>
						</select>
					</div>
					<span style="color:red">*必填项</span>
			</div>
			
				<%if(product.type.name=='瘦身'){%>
				<div id="partText" data-options="region:'center'" style="width: 100%; height:100%; padding: 10px">
							<%for(var i = 0; i<  product.partsExperience.~size; i++){%>
								<div style="margin-bottom: 20px">
									<div class="requiredx">
										${product.partsExperience[i].name! }次数:<input class="easyui-textbox theme-textbox-radius" style="width: 35%;"  value="${product.partsExperience[i].experience! }" name="productExperienceList[${i!}].experience">
									<span style="color:red">*必填项</span>
									</div>
									<input type="hidden" name="productExperienceList[${i!}].ids" value="${product.partsExperience[i].ids! }">
									<input type="hidden" name="productExperienceList[${i!}].partIds" value="${product.partsExperience[i].partIds! }">
								</div>
							<%}%>
				</div>
				<%}%>
			
			
		</form>

	</div>
	
	<script type="text/javascript">
		function showPart() {
			$('#win').window('open');
		}
		//@ sourceURL=mmm.js
		var $form = $('#upProduct');

		var submitNow = function($dialog, $grid, $tree, $pjq) {
			
			$("#partVal").html($("#partText").html());
			var url = "${cxt!}/productSet/upProduct";
			$.post(url, sy.serializeObject($form), function(result) {
				if (result.code == '200') {
					$grid.datagrid('reload');
					$.slideMsg("修改成功！", $pjq);
					$dialog.dialog('destroy');
				} else {
					$.alert($pjq, result.msg);
				}
			}, 'json');
		};
		var submitForm = function($dialog, $grid, $tree, $pjq) {
			submitNow($dialog, $grid, $tree, $pjq);
			// 					$form.isValid(function(isValied){
			// 						if(isValied){
			// 							submitNow($dialog, $grid, $pjq);
			// 						}
			// 					});
		};
	</script>
</body>
</html>